package cn.wolfcode.consumer2.receive;

import org.apache.rocketmq.spring.annotation.MessageModel;
import org.apache.rocketmq.spring.annotation.RocketMQMessageListener;
import org.apache.rocketmq.spring.annotation.SelectorType;
import org.apache.rocketmq.spring.core.RocketMQListener;
import org.springframework.stereotype.Component;

@Component
@RocketMQMessageListener(
        topic = "02-boot",
        consumerGroup = "xxxxxxx",
        messageModel = MessageModel.CLUSTERING,
//        messageModel = MessageModel.BROADCASTING

//        selectorType = SelectorType.TAG,
//        selectorExpression = "tagA"

        selectorType = SelectorType.SQL92,
        selectorExpression = "name='zhangfeixx' and age > 10 or other = 'xxx'"
)
public class ReceiveTest1 implements RocketMQListener<String> {

    @Override
    public void onMessage(String s) {
        System.out.println("A接收到消息是\t"+s);
    }
}
